<template>
    <div>
        <PageHeader title="我的报表">
           <div slot="action">
            <Button type="primary" @click="handleCustom">自定义数据</Button>
        </div>
        </PageHeader>
        <base-info ref="baseInfo" />
        <mypatient ref="mypatient" />
        <Modal v-model="customModel" title="自定义数据">
<Form inline :model="customForm" label-position="left" :label-width="90">
<FormItem label="新增患者">
                <RadioGroup v-model="customForm.newly">
        <Radio label="今"></Radio>
        <Radio label="昨"></Radio>
        <Radio label="周"></Radio>
        <Radio label="月"></Radio>
    </RadioGroup>
        </FormItem>
        <FormItem label="已到">
                <RadioGroup v-model="customForm.arrived">
        <Radio label="今"></Radio>
        <Radio label="昨"></Radio>
        <Radio label="周"></Radio>
        <Radio label="月"></Radio>
    </RadioGroup>
        </FormItem>
        <FormItem label="预到">
                <RadioGroup v-model="customForm.preArrival">
        <Radio label="今"></Radio>
        <Radio label="明"></Radio>
        <Radio label="周"></Radio>
        <Radio label="月"></Radio>
    </RadioGroup>
        </FormItem>
        <FormItem label="过期未到">
                <RadioGroup v-model="customForm.overdue">
        <Radio label="昨"></Radio>
        <Radio label="周"></Radio>
        <Radio label="月"></Radio>
    </RadioGroup>
        </FormItem>
        <FormItem label="已回访人数">
                <RadioGroup v-model="customForm.already">
        <Radio label="今"></Radio>
        <Radio label="昨"></Radio>
        <Radio label="周"></Radio>
        <Radio label="月"></Radio>
    </RadioGroup>
        </FormItem>
        <FormItem label="过期未访">
                <RadioGroup v-model="customForm.overdueVisit">
        <Radio label="昨"></Radio>
        <Radio label="周"></Radio>
        <Radio label="月"></Radio>
    </RadioGroup>
        </FormItem>
</Form>
        </Modal>
    </div>
</template>
<script>
    import baseInfo from './base-info';
    import mypatient from './whole';

    export default {
        name: 'dashboard-console',
        components: { baseInfo, mypatient },
        data () {
            return {
                customModel: false,
                customForm: {
                    newly: '昨日',
                    arrived: '今日',
                    preArrival: '明日',
                    overdue: '昨日',
                    already: '今日',
                    overdueVisit: '上一周'
                },
                visitType: 'day', // day, month, year
                visitDate: [(new Date()), (new Date())]
            }
        },
        methods: {
            handleChangeVisitType (val) {
                if (val === 'week') {
                    this.visitDate = [(new Date() - 86400000 * 7), (new Date())];
                } else if (val === 'month') {
                    this.visitDate = [(new Date() - 86400000 * 30), (new Date())];
                } else if (val === 'year') {
                    this.visitDate = [(new Date() - 86400000 * 365), (new Date())];
                }
            },
            // // 监听页面宽度变化，刷新表格
            // handleResize () {
            //     this.$refs.visitChart.handleResize();
            // },
            handleCustom () {
                this.customModel = true
            }
        }
    }
</script>
<style lang="less" scoped>
    .dashboard-console-visit{
        .ivu-radio-group-button .ivu-radio-wrapper{
            border: none !important;
            box-shadow: none !important;
            padding: 0 12px;
        }
        .ivu-radio-group-button .ivu-radio-wrapper:before, .ivu-radio-group-button .ivu-radio-wrapper:after{
            display: none;
        }
    }
    .ivu-mt-64 {
        margin-top:64px;
    }
    .ivu-page-header {
        padding:0px;
    }
</style>
